home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / utility / makefile < prev    next >
Makefile  |  1996-09-13  |  979b  |  37 lines

  1. TOP=..
  2.  
  3. include $(TOP)/make.cfg
  4.  
  5. FILES = applytagchanges callhookpkt findtagitem nexttagitem \
  6.     stricmp strnicmp tolower toupper getuniqueid smult32 umult32 \
  7.     smult64 umult64 date2amiga amiga2date allocatetagitems \
  8.     freetagitems
  9.  
  10. all: setup $(OSGENDIR)/utility_init.o $(OSGENDIR)/utility_functable.o \
  11.     $(foreach f,$(FILES),$(OSGENDIR)/$(f).o)
  12.  
  13. setup :
  14.     @if [ ! -d $(OSGENDIR) ]; then $(MKDIR) $(OSGENDIR) ; fi
  15.  
  16. clean:
  17.     $(RM) $(OSGENDIR) *.err $(LIBDIR)/libutility.a
  18.  
  19. $(OSGENDIR)/%.o: %.c
  20.     $(CC) $(CFLAGS) $< -c -o $@ 2>&1|tee $*.err
  21.     if test ! -s $*.err; then rm $*.err; fi
  22.  
  23. utility_functable.c: $(foreach f,$(FILES),$(f).c) \
  24.         $(TOP)/scripts/makefunctable.awk
  25.     gawk -f $(TOP)/scripts/makefunctable.awk \
  26.         --assign lib=Utility \
  27.         $(foreach f,$(FILES),$(f).c)
  28.  
  29. $(OSGENDIR)/%.d: %.c
  30.     @if [ ! -d $(OSGENDIR) ]; then $(MKDIR) $(OSGENDIR) ; fi
  31.     @$(RM) $@
  32.     @touch $@
  33.     $(MKDEPEND) -f$@ -p$(OSGENDIR)/ -- $(CFLAGS) -- $^
  34.  
  35. include $(foreach f,$(FILES),$(OSGENDIR)/$(f).d)
  36.  
  37.